<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/vue.js"></script>
    <style>
    </style>
</head>
<body>
    <div id="app">
        <com1>
            <h1 slot="s1">hello</h1>
            <h2 slot="s2">hello</h2>           
        </com1>
    </div>
    <script>
    Vue.component("com1",{
        template:`
            <div>
                组件1
                <slot name="s1"></slot>
                <slot name="s2"></slot>
                <slot></slot>
            </div>
        `
        // 在使用插槽时不指定name和slot属性的话，就会重复添加插入的全部内容 有name和slot属性的话就会渲染对应的元素
    })
        const app = new Vue({
            el:"#app",
            data: {
                page:"mainPage"
            }

        });

    </script>
</body>
</html>